#include "stdafx.h"
#include "AgentProperties.h"
#include "gametime.h"
#include "personalities.h"
#include "emotions.h"

using namespace BAA;

void BAA::AgentProperties::Initialize( Agent * agent)
{
	mParentAgent = agent;

	// specific emotions already intialized during creation
	// no need.

	// personality does not need intialization either
	// unless specific values are wanted.
	

}

void BAA::AgentProperties::Create()
{
	// build basic emotions
	this->mAnger = new Emotion_Anger();
	this->mFear = new Emotion_Fear();
	this->mSadness = new Emotion_Sadness();
	this->mDisgust = new Emotion_Disgust();
	this->mSurprise = new Emotion_Surprise();
	this->mHappyness = new Emotion_Happyness();

	

	this->mPower = new Personality_Power();
	this->mCuriosity = new Personality_Curiosity;
	this->mIndependence = new Personality_Independence();
	this->mStatus = new Personality_Status();
	this->mSocialContact = new Personality_SocialContact();
	this->mVengeance = new Personality_Vengeance();
	this->mHonor = new Personality_Honor();
	this->mIdealism = new Personality_Idealism();
	this->mPhysicalExercise = new Personality_PhysicalExcercise();
	this->mRomance = new Personality_Romance();

	mPower->Create();
	mCuriosity->Create();
	mIndependence->Create();
	mStatus->Create();
	mSocialContact->Create();
	mVengeance->Create();
	mHonor->Create();
	mIdealism->Create();
	mPhysicalExercise->Create();
	mRomance->Create();

	
}

void BAA::AgentProperties::Clear()
{

}

void BAA::AgentProperties::Update( GameTime time )
{

	// update emotions

	if(mAnger != NULL)
		mAnger->Update(time.elasped);

	if(mFear != NULL)
		mFear->Update(time.elasped);

	if(mSadness != NULL)
		mSadness->Update(time.elasped);

	if(mDisgust != NULL)
		mDisgust->Update(time.elasped);

	if(mSurprise != NULL)
		mSurprise->Update(time.elasped);

	if(mHappyness != NULL)
		mHappyness->Update(time.elasped);


	if(mPower != NULL)
		mPower->Update(time.elasped);

	if(mCuriosity != NULL)
		mCuriosity->Update(time.elasped);

	if(mIndependence != NULL)
		mIndependence->Update(time.elasped);

	if(mStatus != NULL)
		mStatus->Update(time.elasped);

	if(mSocialContact != NULL)
		mSocialContact->Update(time.elasped);

	if(mVengeance != NULL)
		mVengeance->Update(time.elasped);

	if(mIdealism != NULL)
		mIdealism->Update(time.elasped);

	if(mPhysicalExercise != NULL)
		mPhysicalExercise->Update(time.elasped);

	if(mRomance != NULL)
		mRomance->Update(time.elasped);

	/*if(mFamily != NULL)
		mFamily->Update(time.elasped);

	if(mOrder != NULL)
		mOrder->Update(time.elasped);

	if(mEating != NULL)
		mEating->Update(time.elasped);

	if(mAcceptance != NULL)
		mAcceptance->Update(time.elasped);

	if(mTranquility != NULL)
		mTranquility->Update(time.elasped);

	if(mSaving!= NULL)
		mSaving->Update(time.elasped);*/

}